package experiment1.sort;

import static util.Util.swap;

public class BubbleSort extends Sort {
    public BubbleSort(int[] arr) {
        super(arr);
    }
    @Override
    public void sort(int left, int right) {
        for (int i = left; i < right; i++) {
            for (int j = 0; j < right - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    swap(arr, j, j + 1);
                }
            }
        }
    }
}
